#!/bin/bash

BUILDDIR=build-clang

if [ ! -d $BUILDDIR ]; then
	mkdir -p $BUILDDIR
fi

cd $BUILDDIR

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -fno-omit-frame-pointer -fstack-protector -fno-exceptions" -DCMAKE_INSTALL_PREFIX=/usr && make -j 4
